﻿Imports System.ComponentModel
Imports FountainHead.ViewModel.Controls
Imports FountainHead.ViewModel.Interfaces
Imports FountainHead.Model

Namespace Properties

    <DefaultPropertyAttribute("Text"), _
DescriptionAttribute("Control Properties")> _
    Public Class AdderProperties
        Inherits BaseProperties
        Public Sub New()

        End Sub
        Public Sub New(ByVal vm As AdderViewModel)
            MyBase.new(vm)
            viewModelValue = vm
        End Sub

        Public Shared AdderProperty As New AdderProperties()

#Region "Properties"
        Private viewModelValue As AdderViewModel
        Public Overloads Property ViewModel() As AdderViewModel
            Get
                Return viewModelValue
            End Get
            Set(ByVal value As AdderViewModel)
                viewModelValue = value
                MyBase.ViewModel = value
            End Set
        End Property

        <CategoryAttribute("Control"), _
           Browsable(True), _
           [ReadOnly](False), _
           BindableAttribute(False), _
           DefaultValueAttribute(""), _
           DesignOnly(False), _
           DescriptionAttribute("Voltage1")> _
        Public Property InputVoltage1() As Double
            Get
                Return ViewModel.Model.InputCurrent1.Voltage
            End Get
            Set(ByVal value As Double)
                ViewModel.Model.InputCurrent1 = New Current(value)

            End Set
        End Property


        <CategoryAttribute("Control"), _
           Browsable(True), _
           [ReadOnly](True), _
           BindableAttribute(False), _
           DefaultValueAttribute(""), _
           DesignOnly(False), _
           DescriptionAttribute("Voltage2")> _
        Public Property InputVoltage2() As Double
            Get
                Return ViewModel.Model.InputCurrent2.Voltage
            End Get
            Set(ByVal value As Double)
                ViewModel.Model.InputCurrent2 = New Current(value)

            End Set
        End Property


        <CategoryAttribute("Control"), _
           Browsable(True), _
           [ReadOnly](True), _
           BindableAttribute(False), _
           DefaultValueAttribute(""), _
           DesignOnly(False), _
           DescriptionAttribute("Enter the Voltage1")> _
        Public ReadOnly Property OutputVoltage() As Double
            Get
                Return ViewModel.Model.OutputCurrent.Voltage
            End Get

        End Property
#End Region
    End Class

End Namespace